<%@ Control Language="C#" AutoEventWireup="true" Inherits="CMS.Web.UI.UserControls.Forum" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="fck" %>

<asp:PlaceHolder ID="phForum" runat="server">
    <asp:Repeater ID="repeaterCategory" runat="server">
        <HeaderTemplate>
            <table>
        </HeaderTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
        <ItemTemplate>
            <tr>
                <td><img src="/Pics/CMS/FilingCabinet.png" alt="Category" /></td>
                <td><%# Eval("ForumCategoryName") %></td>
                <td><%# Eval("ForumCategoryDescription") %></td>
            </tr>
            <tr>
                <td></td>
                <td colspan="2">
                    <asp:Repeater ID="repeaterForum" runat="server">
                        <HeaderTemplate>
                            <table>
                        </HeaderTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                        <ItemTemplate>
                            <tr>
                                <td><img src="/Pics/CMS/FolderClosed.png" alt="Forum" /></td>
                                <td><a href="?Page=<%= Page.PageID %>&Forum=<%# Eval("ForumID") %>"><%# Eval("ForumName") %></a></td>
                                <td><%# Eval("ForumDescription") %></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</asp:PlaceHolder>

<asp:PlaceHolder ID="phPost" runat="server">
    <table>
        <tr>
            <td><img src="/Pics/CMS/FolderClosed.png" alt="Forum" /></td>
            <td><%= BizForum.ForumName %></td>
            <td><%= BizForum.ForumDescription %></td>
        </tr>
    </table>
    <table>
        <tr>
            <td><img src="/Pics/CMS/AddTextDocument.png" alt="Create Post" /></td>
            <td><a href="?Page=<%= Page.PageID %>&Forum=<%= Request.QueryString["Forum"] %>&Create=Post"><asp:Label ID="lCreatePost" runat="server" Text="Create New Post" /></a></td>
            <td></td>
            <td></td>
        </tr>
        <asp:Repeater ID="repeaterPost" runat="server">
            <ItemTemplate>
                <tr>
                    <td><img src="/Pics/CMS/TextDocument.png" alt="Post" /></td>
                    <td><a href="?Page=<%= Page.PageID %>&Forum=<%= Request.QueryString["Forum"] %>&Post=<%# Eval("ForumPostID") %>"><%# Eval("PostTitle") %></a></td>
                    <td><%# Eval("Member.UserName") %></td>
                    <td><%# Eval("CreationDate") %></td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
</asp:PlaceHolder>

<asp:PlaceHolder ID="phMessage" runat="server">
    <table>
        <tr>
            <td>
                <a href="<%= QueryStringForum.Substring(1) %>"><img src="/Pics/CMS/UpFolder.png" alt="Up" /></a>
                <img src="/Pics/CMS/TextDocument.png" alt="Post" />
            </td>
            <td><%= BizPost.PostTitle%></td>
            <td><%= BizPost.Member == null ? "" : BizPost.Member.UserName%></td>
            <td><%= BizPost.CreationDate%></td>
        </tr>
        <tr>
            <td colspan="4"><%= BizPost.PostMessage %></td>
        </tr>
        <tr>
            <td colspan="2">
                <a href="?Page=<%= Page.PageID %>&Forum=<%= Request.QueryString["Forum"] %>&Post=<%= Request.QueryString["Post"] %>&Create=Message"><img src="/Pics/CMS/AddTextDocument.png" alt="Reply" /></a>
                <asp:HyperLink ID="hlEditPost" runat="server" ImageUrl="~/Pics/CMS/EditTextDocument.png" />
                <asp:HyperLink ID="hlDeletePost" runat="server" ImageUrl="~/Pics/CMS/DeleteTextDocument.png" />
            </td>
            <td><%= BizPost.LastModifMember == null ? "" : BizPost.LastModifMember.UserName%></td>
            <td><%= BizPost.LastModifDate %></td>
        </tr>
    <asp:Repeater ID="repeaterMessage" runat="server">
        <ItemTemplate>
           <tr>
                <td><img src="/Pics/CMS/TextDocument.png" alt="Message" /></td>
                <td><%# Eval("MessageTitle") %></td>
                <td><%# Eval("Member.UserName") %></td>
                <td><%# Eval("CreationDate") %></td>
            </tr>
            <tr>
                <td colspan="4"><%# Eval("Message") %></td>
            </tr>
            <tr>
                <td colspan="2">
                    <a href="?Page=<%= Page.PageID %>&Forum=<%= Request.QueryString["Forum"] %>&Post=<%= Request.QueryString["Post"] %>&Message=<%# Eval("ForumMessageID") %>&Create=Message"><img src="/Pics/CMS/AddTextDocument.png" alt="Reply" /></a>
                    <asp:HyperLink ID="hlEditMessage" runat="server" ImageUrl="~/Pics/CMS/EditTextDocument.png" />
                    <asp:HyperLink ID="hlDeleteMessage" runat="server" ImageUrl="~/Pics/CMS/DeleteTextDocument.png" />
                </td>
                <td><%# Eval("LastModifMember.UserName")%></td>
                <td><%# Eval("LastModifDate") %></td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
    </table>
</asp:PlaceHolder>

<asp:PlaceHolder ID="phCreate" runat="server">
    <table>
        <tr>
            <td><asp:Label ID="lTitle" runat="server" Text="Title" /></td>
            <td><asp:TextBox ID="tbTitle" runat="server" /></td>
        </tr>
        <tr>
            <td colspan="2">
                <fck:FCKeditor ID="wysiwygMessage" runat="server" />
            </td>
        </tr>
        <tr>
            <td colspan="2"><asp:Button ID="bSend" runat="server" Text="Send" /></td>
        </tr>
    </table>
</asp:PlaceHolder>
